home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / tex-k-archive.gz / tex-k-archive / 000409_interran@uluru.Stanford.EDU_Thu Mar 17 07:17:34 1994.msg < prev    next >
Internet Message Format  |  1994-10-11  |  7KB

  1. Received: from uluru.Stanford.EDU by cs.umb.edu with SMTP id AA01069
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Thu, 17 Mar 1994 18:14:47 -0500
  3. Received: by uluru.Stanford.EDU (4.1/inc-1.0)
  4.     id AA02765; Thu, 17 Mar 94 15:17:34 PST
  5. Date: Thu, 17 Mar 94 15:17:34 PST
  6. From: interran@uluru.Stanford.EDU (John Interrante)
  7. Message-Id: <9403172317.AA02765@uluru.Stanford.EDU>
  8. To: tex-k@cs.umb.edu
  9. Subject: dvipsk-5.528a: a few changes to make MakeTeXPK.in more useful
  10.  
  11. I needed to make a change or two to allow MakeTeXPK to call gsftopk
  12. and thought I would suggest some improvements for the next release.
  13. The first improvement I suggest is to replace all commands of the form
  14.  
  15. : ${variable=value}
  16.  
  17. with the more straightforward command
  18.  
  19. variable=value
  20.  
  21. The sh(1) man page says that a : command does nothing and returns a
  22. zero exit status.  Variable substitution still takes place, however,
  23. and since the variable=value assignment is enclosed inside ${}, it is
  24. executed even though the result of the ${} is immediately thrown away.
  25. When I first modified MakeTeXPK to call gsftopk, I thought that the :
  26. command was equivalent to # (a comment line), so I changed
  27.  
  28. : ${gsftopk=""}
  29.  
  30. to
  31.  
  32. ${gsftopk="gsftopk"}
  33.  
  34. I was pretty surprised when MakeTeXPK then called gsftopk twice
  35. instead of only once.  Then I realized that ${gsftopk="gsftopk"} meant
  36. not only assign the string "gsftopk" to the variable gsftopk, but also
  37. substitute $gsftopk's value into the command line, thus calling
  38. gsftopk without any arguments.  All of this confusion would have been
  39. avoided if the command had been
  40.  
  41. gsftopk=""
  42.  
  43. in the first place.  Then I would have changed it to
  44.  
  45. gsftopk="gsftopk"
  46.  
  47. and it would have worked fine.  There is no reason at all why the
  48. perfectly fine command variable=value should be replaced with the
  49. cryptic-looking command : ${variable=value}, so I have de-obfuscated
  50. all such lines in MakeTeXPK.
  51.  
  52. Once I finally got MakeTeXPK to call gsftopk only once, I had to make
  53. it echo the actual filename of the generated pk file.  It was echoing
  54. the name of the font, not the filename of the pk file.  It was also
  55. leaving the pk file in the current directory and I didn't like that so
  56. I made it move the generated pk file into the same directory that
  57. MakeTeXPK moves the Metafont-generated pk files.
  58.  
  59. Finally, I took a look at the rest of MakeTeXPK and tried to make
  60. things a little more consistent (i.e., saying "Running command"
  61. everywhere instead of saying "Running command" here and just "command"
  62. there, forgetting to check a command's exit status, etc.).
  63.  
  64.         John
  65.  
  66. *** dvipsk/MakeTeXPK.in.save    Mon Feb 21 14:42:32 1994
  67. --- dvipsk/MakeTeXPK.in    Thu Mar 17 14:27:17 1994
  68. ***************
  69. *** 22,42 ****
  70.   echo "Running MakeTeXPK $*" 1>&2
  71.   
  72.   # The root of where to put the new file. The Makefile substitutes for this.
  73. ! : ${DESTDIR=${MTP_DESTDIR-@mtp_destdir@}}
  74.   
  75.   # Define to `gsftopk' or `ps2pk' or whatever to make PK files for
  76.   # PostScript fonts. If this is defined, MAPFILE must also be defined to
  77.   # be your psfonts.map file or some equivalent. The Makefile substitutes
  78.   # for this, too. You can get gsftopk from
  79.   # math.berkeley.edu:pub/Software/TeX/gsftopk.tar.Z.
  80. ! : ${gsftopk=""}
  81. ! : ${MAPFILE=@configdir@/psfonts.map}
  82.   
  83.   # If this directory doesn't exist, the Sauter stuff won't be attempted.
  84. ! : ${sauterdir=/usr/local/src/TeX+MF/tex82/utilities/sauter}
  85.   
  86.   # Likewise, for the F3 stuff.
  87. ! : ${f3dir=/groups/dtrg/typescaler/fonts/f3b}
  88.   
  89.   # TEMPDIR needs to be unique for each process because of the possibility
  90.   # of simultaneous processes running this script.
  91. --- 22,42 ----
  92.   echo "Running MakeTeXPK $*" 1>&2
  93.   
  94.   # The root of where to put the new file. The Makefile substitutes for this.
  95. ! DESTDIR=${MTP_DESTDIR-@mtp_destdir@}
  96.   
  97.   # Define to `gsftopk' or `ps2pk' or whatever to make PK files for
  98.   # PostScript fonts. If this is defined, MAPFILE must also be defined to
  99.   # be your psfonts.map file or some equivalent. The Makefile substitutes
  100.   # for this, too. You can get gsftopk from
  101.   # math.berkeley.edu:pub/Software/TeX/gsftopk.tar.Z.
  102. ! gsftopk=""
  103. ! MAPFILE=@configdir@/psfonts.map
  104.   
  105.   # If this directory doesn't exist, the Sauter stuff won't be attempted.
  106. ! sauterdir=/usr/local/src/TeX+MF/tex82/utilities/sauter
  107.   
  108.   # Likewise, for the F3 stuff.
  109. ! f3dir=/groups/dtrg/typescaler/fonts/f3b
  110.   
  111.   # TEMPDIR needs to be unique for each process because of the possibility
  112.   # of simultaneous processes running this script.
  113. ***************
  114. *** 89,100 ****
  115.   
  116.   # Do we have a GF file in the current directory?
  117.   if test -r $GFNAME; then
  118. !   echo "gftopk ./$GFNAME $PKNAME" >&2
  119. !   gftopk ./$GFNAME $PKNAME
  120. !   # Don't move the font; if the person knows enough to make fonts, they
  121. !   # know enough to have . in the font paths.
  122. !   echo $PKNAME
  123. !   exit 0
  124.   fi
  125.   
  126.   # Do we have an F3 font?
  127. --- 89,104 ----
  128.   
  129.   # Do we have a GF file in the current directory?
  130.   if test -r $GFNAME; then
  131. !   echo "Running gftopk ./$GFNAME $PKNAME" >&2
  132. !   if gftopk ./$GFNAME $PKNAME; then
  133. !     # Don't move the font; if the person knows enough to make fonts, they
  134. !     # know enough to have . in the font paths.
  135. !     echo $PKNAME
  136. !     exit 0
  137. !   else
  138. !     echo "gftopk failed." >&2
  139. !     exit 1
  140. !   fi
  141.   fi
  142.   
  143.   # Do we have an F3 font?
  144. ***************
  145. *** 102,108 ****
  146.     # You will need Sun's f3tobm program, plus a program I wrote.
  147.     # See ftp.cs.umb.edu:private/f3totex.
  148.     cd $f3dir || exit 1
  149. !   echo "f3topk -r $DPI $NAME" >&2
  150.     if f3topk -r $DPI $NAME; then
  151.       # Best if f3topk echoes its output filename, I think.
  152.       exit 0
  153. --- 106,112 ----
  154.     # You will need Sun's f3tobm program, plus a program I wrote.
  155.     # See ftp.cs.umb.edu:private/f3totex.
  156.     cd $f3dir || exit 1
  157. !   echo "Running f3topk -r $DPI $NAME" >&2
  158.     if f3topk -r $DPI $NAME; then
  159.       # Best if f3topk echoes its output filename, I think.
  160.       exit 0
  161. ***************
  162. *** 114,122 ****
  163.   
  164.   # Is this a PostScript font?
  165.   if test -n "$gsftopk" && egrep \^$NAME'([     ]|$)' $MAPFILE >/dev/null; then
  166. !   echo "Running $gsftopk $NAME $DPI." >&2
  167.     if $gsftopk $NAME $DPI >&2; then
  168. !     echo $NAME
  169.       exit 0
  170.     else
  171.       echo "$gsftopk failed."
  172. --- 118,133 ----
  173.   
  174.   # Is this a PostScript font?
  175.   if test -n "$gsftopk" && egrep \^$NAME'([     ]|$)' $MAPFILE >/dev/null; then
  176. !   echo "Running $gsftopk $NAME $DPI" >&2
  177.     if $gsftopk $NAME $DPI >&2; then
  178. !     test -d $DESTDIR \
  179. !       || mkdir $DESTDIR \
  180. !       || (echo "${DESTDIR}: MakeTeXPK could not create directory." >&2; exit 1)
  181. !     mv $PKNAME $DESTDIR/pktmp.$$ \
  182. !       || (echo "$0: Could not mv $PKNAME $DESTDIR/pktmp.$$." >&2; exit 1)
  183. !     cd $DESTDIR || exit 1
  184. !     mv pktmp.$$ $PKNAME
  185. !     echo $DESTDIR/$PKNAME
  186.       exit 0
  187.     else
  188.       echo "$gsftopk failed."